<?
class barres_laterales_contenu{

	var $id;
	var $nom;
	var $type;
	var $module;
	var $texte;

	function barres_laterales_contenu($var){
		if(is_object($var)){
			$this->id=$var->id;
			$this->nom=$var->nom;
			$this->type=$var->type;
			$this->module=$var->module;
			$this->texte=$var->texte;
		}
		if(is_array($var)){
			$this->id=$var["id"];
			$this->nom=$var["nom"];
			$this->type=$var["type"];
			$this->module=$var["module"];
			$this->texte=$var["texte"];
		}
	}

	function get_id(){ return stripslashes($this->id); }
	function set_id($value){ $this->id=$value; }
	function get_nom(){ return stripslashes($this->nom); }
	function set_nom($value){ $this->nom=$value; }
	function get_type(){ return stripslashes($this->type); }
	function set_type($value){ $this->type=$value; }
	function get_module(){ return stripslashes($this->module); }
	function set_module($value){ $this->module=$value; }
	function get_texte(){ return stripslashes($this->texte); }
	function set_texte($value){ $this->texte=$value; }


	function ajouter(){
		global $sql;
		$sqlr="insert into ".CFG_MYSQL_PREFIX."barres_laterales_contenu(nom,type,module,texte) values('".addslashes($this->nom)."','".addslashes($this->type)."','".addslashes($this->module)."','".addslashes($this->texte)."')";
		$sql->query($sqlr,0);
	}

	function maj(){
		global $sql;
		$sql->query("update ".CFG_MYSQL_PREFIX."barres_laterales_contenu set nom='".addslashes($this->nom)."',type='".addslashes($this->type)."',module='".addslashes($this->module)."',texte='".addslashes($this->texte)."' where id=".$this->id,0);
	}
	
	function supprimer(){
		global $sql;
		$sql->query("delete from ".CFG_MYSQL_PREFIX."barres_laterales_contenu where id=".$this->id);
	}

}